home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 124 / cd-rom 124.iso / edu / tuxmath / tuxmathscrabble / asymptopia / Spot.pyc (.txt) < prev    next >
Encoding:
Python Compiled Bytecode  |  2003-11-16  |  4.5 KB  |  100 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 2.2)
  3.  
  4. '''
  5. /***************************************************************************
  6.  
  7. \tAuthor \t\t\t:Charles B. Cosse 
  8. \t
  9. \tEmail\t\t\t:ccosse@asymptopia.com
  10. \t\t\t\t\t
  11. \t\t\t\t\t
  12. \tCopyright\t\t:(C) 2002,2003 Asymptopia Software.
  13. \t
  14.  ***************************************************************************/
  15. /***************************************************************************
  16.                           Spot.py
  17.  
  18.  ***************************************************************************/
  19.  
  20. /***************************************************************************
  21.  *                                                                         *
  22.  *   This program is free software; you can redistribute it and/or modify  *
  23.  *   it under the terms of the GNU General Public License as published by  *
  24.  *   the Free Software Foundation; either version 2 of the License, or     *
  25.  *   (at your option) any later version. (Please note that if you use this *
  26.  *   code you must give credit by including the Author and Copyright       *
  27.  *   info at the top of this file).                                        *
  28.  ***************************************************************************/
  29. '''
  30. import pygame
  31. from pygame.locals import *
  32. from myutil import *
  33.  
  34. class Spot(pygame.sprite.Sprite):
  35.     
  36.     def __init__(self, default_image, M, N, TYPE):
  37.         pygame.sprite.Sprite.__init__(self)
  38.         if default_image:
  39.             (self.default_image, self.rect) = load_image(default_image, -1)
  40.             self.image = self.default_image
  41.         else:
  42.             self.default_image = None
  43.             self.rect = pygame.Rect(0, 0, 0, 0)
  44.             self.image = None
  45.         self.guest = None
  46.         self.locked = 0
  47.         self.M = M
  48.         self.N = N
  49.         self.TYPE = TYPE
  50.         self.AMHEAD = 0
  51.         self.AMROWEXPR = 0
  52.         self.AMCOLEXPR = 0
  53.         self.ROWEXPRLENGTH = 0
  54.         self.COLEXPRLENGTH = 0
  55.  
  56.     
  57.     def setMN(self, M, N):
  58.         self.M = M
  59.         self.N = N
  60.  
  61.     
  62.     def getMN(self):
  63.         return (self.M, self.N)
  64.  
  65.     
  66.     def take_guest(self, guest, use_guest_image):
  67.         self.guest = guest
  68.         self.guest.rect.center = self.rect.center
  69.         if use_guest_image:
  70.             self.image = guest.image
  71.         
  72.  
  73.     
  74.     def lock(self):
  75.         self.locked = 1
  76.  
  77.     
  78.     def islocked(self):
  79.         return self.locked
  80.  
  81.     
  82.     def occupied(self):
  83.         if self.guest == None:
  84.             return 0
  85.         
  86.         return 1
  87.  
  88.     
  89.     def pop_guest(self):
  90.         self.image = self.default_image
  91.         guest = self.guest
  92.         self.guest = None
  93.         return guest
  94.  
  95.     
  96.     def update(self):
  97.         pass
  98.  
  99.  
  100.